package tt.com.common.model;

import com.baomidou.mybatisplus.annotation.*;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.ToString;
import tt.com.common.annotation.IsNull;
import tt.com.common.enums.AuditEnum;

import java.math.BigDecimal;
import java.util.Date;

/**
 * 采购单
 * IsNull
 * <br> purchaseTime(采购日期)
 * <br> purchaseNo(采购订单号)
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
@ToString
@TableName(value = "yx_common_purchase")
public class YxCommonPurchase {
    public static final String COL_ID = "id";
    public static final String COL_CREATE_TIME = "create_time";
    public static final String COL_CREATE_USER_ID = "create_user_id";
    public static final String COL_LAST_UPDATE_TIME = "last_update_time";
    public static final String COL_LAST_UPDATE_USER_ID = "last_update_user_id";
    public static final String COL_DELETE_TIME = "delete_time";
    public static final String COL_DELETE_USER_ID = "delete_user_id";
    public static final String COL_DATA_STATUS = "data_status";
    public static final String COL_ORGAN_ID = "organ_id";
    public static final String COL_PURCHASE_TIME = "purchase_time";
    public static final String COL_PROVIDERS_ID = "providers_id";
    public static final String COL_PURCHASE_NO = "purchase_no";
    public static final String COL_TOTAL_COST = "total_cost";
    public static final String COL_TYPE = "type";
    public static final String COL_STATUS = "status";
    @TableId(value = "id", type = IdType.ASSIGN_ID)
    private Long id;
    /**
     * 创建时间
     */
    @TableField(value = "create_time")
    private Date createTime;
    /**
     * 创建人
     */
    @TableField(value = "create_user_id")
    private String createUserId;
    /**
     * 最后修改时间
     */
    @TableField(value = "last_update_time")
    private Date lastUpdateTime;
    /**
     * 最后修改人
     */
    @TableField(value = "last_update_user_id")
    private String lastUpdateUserId;
    /**
     * 删除时间
     */
    @TableField(value = "delete_time")
    private Date deleteTime;
    /**
     * 删除人
     */
    @TableField(value = "delete_user_id")
    private String deleteUserId;
    /**
     * 删除状态(0删除 1正常)
     */
    @TableLogic
    @TableField(value = "data_status")
    private Integer dataStatus;
    /**
     * 组织id
     */
    @TableField(value = "organ_id")
    private String organId;
    /**
     * 采购日期
     */
    @JsonFormat(pattern = "yyyy-MM-dd")
    @TableField(value = "purchase_time")
    @IsNull
    private Date purchaseTime;
    /**
     * 供应商id
     */
    @TableField(value = "goods_id")
    private String goodsId;
    /**
     * 采购订单号
     */
    @TableField(value = "purchase_no")
    @IsNull
    private String purchaseNo;
    /**
     * 采购单总金额
     */
    @TableField(value = "total_cost")
    private BigDecimal totalCost;
    /**
     * 采购单类型（1：购货）
     */
    @TableField(value = "`type`")
    private Integer type;
    /**
     * 采购状态（0：待审核 1：审核通过 2：审核不通过）
     */
    @TableField(value = "`status`")
    private AuditEnum status;
}